package com.kaibes.web.prefix;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebViewConfig implements WebMvcConfigurer {

	private ResourceHandlerRegistry registry;

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		this.registry = registry;
	}
	
	public ResourceHandlerRegistry getRegistry() {
		return registry;
	}
	
	/**
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        //禁止后缀扩展，如index访问 index.html
        configurer.setUseSuffixPatternMatch(false);
    }
    @Override
    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
        configurer.favorPathExtension(false).favorParameter(true).parameterName("mediaType").ignoreAcceptHeader(true).defaultContentType(MediaType.APPLICATION_JSON);
    }
    **/
	
}
